import { View } from "../../../mvc/core/View";
import { ILayOut } from "../../../../modules/interfaces/ILayOut";
import { LayerManager } from "../../manager/LayerManager";
import { ObjCreate } from "../common/ObjCreate";
import { ResFileConst } from "../../resource/ResFileConst";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { Global } from "../../../../com/gengine/global/Global";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
//class FireworkIconView
    
    export  class FireworkIconView extends View implements ILayOut
    {
        constructor()
        {
            super();
            this.layer = LayerManager.rightTopUILayer;
            this.createChildren();
            this.resetPosition();
            return;
        }

        /* internal  */createChildren(): void
        {
            this._btnFireworkBtn = ObjCreate.createGLoadedButton(ResFileConst.fireworkIcon, 5, 0, 50, 50, this);
            this._btnFireworkBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onFireworkBtnClick);
            return;
        }

        /* internal  */onFireworkBtnClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.FireworkIconClick));
            return;
        }

        public resetPosition(): void
        {
            this.x = Global.stage.stageWidth - 490;
            this.y = 10;
            return;
        }

        /* internal */ /* var */_btnFireworkBtn: GLoadedButton;
    }
